package tech.aistar.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tech.aistar.model.entity.Cart;
import tech.aistar.model.entity.Collect;
import tech.aistar.model.entity.Product;

import java.util.List;

public interface CollectMapper {


    void save(Collect collect);

    @Delete("delete from collect where id=#{value}")
    int delById(Integer id);

    @Select("select * from collect where product_id=#{productId} and user_id=#{userId}")
    Collect find(@Param("productId") Integer productId, @Param("userId") Integer userId);

    @Select("select * from collect where user_id=#{value}")
    List<Collect> findAll(Integer userId);
}
